Class Node

java.lang.Object
edu.claflin.finder.logic.Node
All Implemented Interfaces:
Comparable<Node>
Direct Known Subclasses:
ModuleNode

public class Node extends Object implements Comparable<Node>
Represents a node in memory. A simple implementation requiring only an identifier.
Version:
1.1.1 June 16, 2015
Author:
Charles Allen Schultz II
  • Field Details

    • identifier

      private final String identifier
      The string representing the node's unique name.
    • intIdentifier

      private int intIdentifier
    • freq

      private int freq
    • edges

      private List<Edge> edges
    • neighbors

      private List<Node> neighbors
    • degree

      private int degree
    • weight

      private double weight
  • Constructor Details

    • Node

      public Node(String identifier)
      Initializes the Node object.
      Parameters:
      identifier - the String representing the Node's identifier.
  • Method Details

    • getIdentifier

      public String getIdentifier()
      Access method for the Node's identifier.
      Returns:
      the String identifying the Node.
    • getIntegerIdentifier

      public int getIntegerIdentifier()
      Get the index of the Node in its Graph's Node list.
      Returns:
      the index in the graph node list
    • getEdge

      public Edge getEdge(Node t)
    • getEdges

      public List<Edge> getEdges()
      Get the Node's edges
      Returns:
      the node's edges
    • getNeighbors

      public List<Node> getNeighbors()
      Get the Node's neighbors
      Returns:
      the node's neighbors
    • getDegree

      public int getDegree()
      Get the Node's in-degree.
      Returns:
      the node's degree
    • getWeight

      public double getWeight()
      Get the Node's weight
      Returns:
      the node's weight
    • setIntegerIdentifier

      public void setIntegerIdentifier(int i)
    • addEdge

      public void addEdge(Edge e)
      Add an Edge to the Node and increase the other statistics accordingly.
      Parameters:
      e - the Edge to add
    • removeEdge

      public void removeEdge(Edge e)
    • duplicate

      public Node duplicate()
      Returns a copy of this Node that is a new object in memory.
      Returns:
      the copy of the Node
    • incrementFreq

      public void incrementFreq()
    • getFreq

      public int getFreq()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Node that)
      Specified by:
      compareTo in interface Comparable<Node>